package com.ruoyi.web.controller.custom;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.custom.service.ICustomService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Api(tags = "首页统计")
@RestController
@RequestMapping("/custom/index")
public class IndexController  extends BaseController {

    @Autowired
    private ICustomService customService;
    @GetMapping(value = "/count")
    public AjaxResult count()
    {
        return AjaxResult.success(customService.getIndexCount());
    }

    /**
     * 表格数据
     * @return
     */
    @GetMapping(value = "/table")
    public AjaxResult table()
    {
        return AjaxResult.success(customService.getIndexTableCount());
    }
}
